package com.capgemini.crm.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.capgemini.core.AjaxResponse;
import com.capgemini.core.PageList;
import com.capgemini.crm.pojo.RoadsideServicePOJO;
import com.capgemini.crm.service.RoadsideService;

@Controller
@RequestMapping("/rss")
public class RoadsideServiceController {
	// 日志记录器
	public final Logger log = LoggerFactory.getLogger(this.getClass());
	@Autowired
	private RoadsideService roadsideService;

	@RequestMapping("/query")
	public Object manage() {

		ModelAndView mv = new ModelAndView("/crm/roadsideservice.jsp");

		return mv;
	}


	/**
	 * 公告List
	 * @param pageList
	 * @param pojo
     * @return
     */
	@RequestMapping("/list")
	@ResponseBody
	public Object list(PageList<RoadsideServicePOJO> pageList, RoadsideServicePOJO pojo) {
		AjaxResponse ajaxResponse = new AjaxResponse();

		pageList.setParam(pojo);
		roadsideService.queryPage(pageList);

		ajaxResponse.setData(pageList);

		return ajaxResponse;
	}


}
